package com.wicket.okrframework.web.contorller;

import com.wicket.okrframework.biz.service.PasswordService;
import com.wicket.okrframework.biz.service.dto.req.UpdateChangePasswordReqDto;
import com.wicket.okrframework.biz.service.dto.res.UpdateChangePasswordRespDto;
import com.wicket.okrframework.common.ro.OkrResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.biz.service.dto.res.ChangePasswordComRespDto;
import com.wicket.okrframework.biz.service.dto.req.ChangePasswordComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/base/password/")
public class PasswordController {

    @Autowired
    PasswordService passwordService;

    /**
   * D1-2修改密码
   */
    @PostMapping("updateChangePassword")
    public OkrResult<UpdateChangePasswordRespDto> updateChangePassword(@RequestBody @Validated UpdateChangePasswordReqDto reqDTO){
    return OkrResult.success(passwordService.updateChangePassword(reqDTO));
    }
/**
   * D1-2修改密码(公共)
   */
    @PostMapping("changePasswordCom")
    public OkrResult<ChangePasswordComRespDto> changePasswordCom(@RequestBody @Validated ChangePasswordComReqDto reqDTO){
    return OkrResult.success(passwordService.changePasswordCom(reqDTO));
    }
}
